package vn.gameloft.egg.model;

import com.badlogic.gdx.Gdx;

public class Basket extends GameObject {

    public static int EGG_MOVE_MAX_SPEED = 400;

    public int point = 0;

    public float eggSpeed = 100;

    public int level = 0;

    public Basket() {
        super(Gdx.files.internal("Ro.png"));
    }

    public boolean isOverlap(Egg egg) {
        if (this.x > egg.x + egg.getWidth() || this.x + this.getWidth() < egg.x
                || this.y > egg.y + egg.getHeight()
                || this.y + this.getHeight() < egg.y)
            return false;
        return true;
    }

    public void setPoint(boolean isChatThai) {
        if (isChatThai) {
            point--;
            if (level > 0) {
                level--;
            }
        } else {
            point++;
            level++;
            if (level == 20 && eggSpeed < EGG_MOVE_MAX_SPEED) {
                level = 0;
                eggSpeed += 50;
            }
        }

    }

}
